﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Orion.Lib
{
   public class GraphicElement: IComparable<GraphicElement>, IDisposable
    {

       int x, y,z;

       public GraphicElement()
       { }

       public GraphicElement(Texture2D _texture)
       { texture = _texture; }

       public Texture2D texture;

       public int ZIndex
       {
           get { return z; }
           set { z = value; }
       }

       public int Width
       {
           get { return texture != null ? texture.Width : 0; }
       }

       public int Height
       {
           get { return texture != null ? texture.Height : 0; }
       }

       public int PossitionX
       {
           get { return x; }
           set { x = value; }
       }

       public int PossitionY
       {
           get { return y; }
           set { y = value; }
       }

       public Vector2 Possition
       {
           get
           { return new Vector2(x, y); }
       }

       public virtual void Update(GameTime gameTime)
       {   }

       public virtual void Draw(GameTime gameTime)
       { }

       #region IComparable<GraphicElement> Members

       public int CompareTo(GraphicElement other)
       {
           return ZIndex.CompareTo(other.ZIndex);
       }

       #endregion

       #region IDisposable Members

       public void Dispose()
       {
         
       }

       #endregion
    }
}
